<?php
require_once("Elements.php");

class ProfileMessageForm extends Zend_Form {
	
	private $post_user_id;
	private $target_user_id;
	
	public function ProfileMessageForm($post_user_id, $target_user_id) {
		$this->post_user_id = $post_user_id;
		$this->target_user_id = $target_user_id;
		$this->__construct();
	}
	
	public function init() {		
		$this->setMethod('post');
		
		$this->addElement('hidden', 'return', array(
       /* 'value' => Zend_Controller_Front::getInstance()->getRequest()->getRequestUri(),*/  
        'value' => 'user/index/uid/'.$this->target_user_id.'#/messageboard',                         
                ));
		
        $element = new Zend_Form_Element_Hidden('type');
		$element->setValue(UserMessage::PUBLIC_MESSAGE);
		$this->addElement($element);
                
		$element = new Zend_Form_Element_Hidden('post_user_id');
		$element->setValue($this->post_user_id);
		$this->addElement($element);
		
		$element = new Zend_Form_Element_Hidden('target_user_id');
		$element->setValue($this->target_user_id);
		$this->addElement($element);
		
		$elements = new Elements();
		$element = $elements->getCommentTextField();
		$element->setAttrib('cols', 50)->setAttrib('rows', 1);
		$element->setValue('');
		$element->removeDecorator('Label'); //Remove unneccesary dt label
		$this->addElement($element);
		
		$submit = $this->createElement('submit', 'submit');
		$submit->setName('post');
		$submit->removeDecorator('DtDdWrapper');	//Remove unneccesary dt label	
		$this->addElement($submit);
	}
}
?>